"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url,include
# from django.contrib import admin
from . views import Indexviews,Userviews,Typesviews,Goodsviews,Orderviews

urlpatterns = [

    #网站后台首页

    url(r'^$', Indexviews.index,name='admin_index'),
    #登录页面
    url(r'^login/$', Indexviews.adminlogin,name='admin_login'),

    #验证码
    url(r'^vcode/$', Indexviews.vcode,name='admin_vcode'),

    #退出

    url(r'^logout/$', Indexviews.adminlogout,name='admin_logout'),



    # 管理员列表路由
    url(r'^auth/user/$', Indexviews.authuser,name='admin_authuser'),
    #管理员添加
    url(r'^auth/user/add/$', Indexviews.authuseradd,name='admin_authuseradd'),

    # 授权组列表路由
    url(r'^auth/group/$', Indexviews.authgroup,name='admin_authgroup'),
    #添加组
    url(r'^authgroup/add/$', Indexviews.authgroupadd,name='admin_authgroupadd'),
    #编辑组
    url(r'^authgroup/edit/(?P<gid>[0-9]+)/$', Indexviews.authgroupedit,name='admin_authgroup_edit'),



    #会员管理
    url(r'^user/add/$', Userviews.add,name='admin_user_add'),
    url(r'^user/insert/$', Userviews.insert,name='admin_user_insert'),
    url(r'^user/index/$', Userviews.index,name='admin_user_index'),
    url(r'^user/delete/$', Userviews.delete,name='admin_user_del'),
    url(r'^user/edit/(?P<uid>[0-9]+)/$', Userviews.edit,name='admin_user_edit'),

    #分类管理types
    url(r'^types/add/$', Typesviews.add,name='admin_type_add'),
    url(r'^types/insert/$', Typesviews.insert,name='admin_type_insert'),
    url(r'^types/index/$', Typesviews.index,name='admin_type_index'),
    url(r'^types/delete/$', Typesviews.delete,name='admin_type_del'),
    url(r'^types/edit/(?P<tid>[0-9]+)/$', Typesviews.edit,name='admin_type_edit'),



    #商品管理goods
    url(r'^goods/add/$', Goodsviews.add,name='admin_goods_add'),
    url(r'^goods/insert/$', Goodsviews.insert,name='admin_goods_insert'),
    url(r'^goods/index/$', Goodsviews.index,name='admin_goods_index'),
    url(r'^goods/delete/$', Goodsviews.delete,name='admin_goods_del'),
    url(r'^goods/edit/(?P<gid>[0-9]+)/$', Goodsviews.edit,name='admin_goods_edit'),



    #订单管理
    url(r'^order/list/$', Orderviews.orderlists,name='admin_order_list'),
    #订单详情页面
    url(r'^order/info/(?P<oid>[0-9]+)/$', Orderviews.orderinfo,name='admin_order_info'),
    #发货事件

    url(r'^order/fahuo/$', Orderviews.orderfahuo,name='admin_order_fahuo'),

]
